<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <title>能耗监测 - 智慧粮仓</title>
    <link rel="stylesheet" href="../css/theme.css" />
    <link rel="stylesheet" href="../css/common.css" />
    <link rel="stylesheet" href="../css/energyconsumptionmonitoring.css" />
    <link rel="stylesheet" href="../css/iconfont.css" />
    <link rel="stylesheet" href="../css/iconfont.ttf" />
    <link rel="stylesheet" href="../layui-v2.8.17/layui/css/layui.css" />
    <!-- VConsole 初始化 -->
    <script src="../lib/vconsole/vconsole.min.js"></script>
    <script src="../js/vconsole-init.js"></script>
    <script src="../layui-v2.8.17/layui/layui.js"></script>
    <script src="../lib/jquery.js"></script>
    <script src="../lib/echarts.min.js"></script>
    <!-- 通用工具库 -->
    <script src="../lib/utils.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/widgets.js"></script>
    <script src="../js/warom-utils.js"></script>
    <script src="../js/android-interface.js"></script>
    <!-- 全局配置 -->
    <script src="../js/config.js"></script>
    <!-- 模拟数据 -->
    <script src="../js/mock/mock-energy-data.js"></script>
    <script src="../js/energyconsumptionmonitoring.js"></script>

    <!-- 统一主题样式 -->
    <style>
      /* 全局样式 */
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: "Roboto", "PingFang SC", "Microsoft YaHei", sans-serif;
      }
      
      body {
        background: linear-gradient(130deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
        color: var(--theme-text-color);
        height: 100vh;
        width: 100vw;
        overflow: hidden;
      }
      
      /* 主要内容区域 */
      main {
        height: calc(100vh - 64px);
        padding: 16px;
        margin-top: 0;
        overflow-y: auto;
      }
      
      /* 标签页样式 */
      .layui-tab {
        margin: 0;
      }
      
      .layui-tab-title {
        border: none;
        height: 48px;
        background: transparent;
      }
      
      .layui-tab-title li {
        color: rgba(255, 255, 255, 0.7);
        font-size: 18px;
        min-width: 100px;
        padding: 0 16px;
      }
      
      .layui-tab-title .layui-this {
        color: var(--theme-text-color);
        font-weight: 500;
      }
      
      .layui-tab-title .layui-this:after {
        height: 3px;
        border: none;
        background-color: #1976D2;
      }
      
      .layui-tab-content {
        padding: 16px 0;
      }
      
      /* 概览卡片样式 */
      .power-overview-summary {
        background: var(--theme-card-bg);
        border: 1px solid var(--theme-card-border);
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 20px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: var(--theme-card-shadow);
      }
      
    
      
      .summary-row {
        display: flex;
        justify-content: space-between;
        gap: 20px;
      }
      
      .summary-item {
        flex: 1;
        text-align: center;
        padding: 16px;
        /* background: rgba(255, 255, 255, 0.1); */
        border-radius: 8px;
        border: 1px solid var(--theme-card-border);
      }
      
      .summary-label {
        display: block;
        font-size: 14px;
        color: rgba(255, 255, 255, 0.8);
        margin-bottom: 8px;
      }
      
      .summary-value {
        display: block;
        font-size: 24px;
        font-weight: bold;
        color: var(--theme-text-color);
      }
      
      /* 电力测点列表样式 */
      .power-data-list {
        list-style: none;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 16px;
      }
      
      .power-data-list li {
        background: var(--theme-card-bg);
        border: 1px solid var(--theme-card-border);
        border-radius: 12px;
        padding: 20px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: var(--theme-card-shadow);
        transition: transform 0.2s ease;
      }
      
      .power-data-list li:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px var(--theme-card-shadow);
      }
      
      .power-point {
        color: var(--theme-text-color);
      }
      
      .power-point .point-name {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 12px;
        color: var(--theme-text-color);
      }
      
      .power-point .point-data {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
      }
      
      .power-point .data-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      }
      
      .power-point .data-item:last-child {
        border-bottom: none;
      }
      
      .power-point .data-label {
        font-size: 14px;
        color: rgba(255, 255, 255, 0.8);
      }
      
      .power-point .data-value {
        font-size: 16px;
        font-weight: 600;
        color: var(--theme-text-color);
      }
      
      /* 开发中提示样式 */
      .main-list {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 200px;
        background: var(--theme-card-bg);
        border: 1px solid var(--theme-card-border);
        border-radius: 12px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
      }
      
      .main-list p {
        font-size: 18px;
        color: rgba(255, 255, 255, 0.6);
      }
      
      /* 响应式调整 */
      @media screen and (max-width: 768px) {
        .summary-row {
          flex-direction: column;
          gap: 12px;
        }
        
        .power-data-list {
          grid-template-columns: 1fr;
        }
        
        .power-point .point-data {
          grid-template-columns: 1fr;
        }
      }
    </style>
  </head>
  <body>
    <!-- 公共头部 -->
    <header class="common-header"></header>
    
    <main>
      <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
          <li class="layui-this">实时监测</li>
          <li style="display: none;">历史数据</li>
          <li style="display: none;">统计分析</li>
        </ul>
        <div class="layui-tab-content">
          <!-- 电力监测标签页 - 内容将由JavaScript动态生成 -->
          <div class="layui-tab-item layui-show">
            <div id="power-monitoring-content">
              <!-- 电力监测标题 -->
              <!-- <div class="section-title">电力监测</div> -->
              
              <!-- 电力监测概览卡片 -->
              <div class="power-overview-summary">
              
                <div class="summary-row">
                  <div class="summary-item">
                    <span class="summary-label">总能耗</span>
                    <span id="total-power" class="summary-value">0.00 kWh</span>
                  </div>
                  <div class="summary-item">
                    <span class="summary-label">平均电压</span>
                    <span id="avg-voltage" class="summary-value">0.0 V</span>
                  </div>
                  <div class="summary-item">
                    <span class="summary-label">平均电流</span>
                    <span id="avg-current" class="summary-value">0.00 A</span>
                  </div>
                </div>
              </div>
              
              <!-- 电力测点列表 -->
              <ul class="power-data-list">
                <!-- 动态生成的测点将被添加到这里 -->
              </ul>
            </div>
          </div>
          
          <!-- 历史数据标签页 -->
          <div class="layui-tab-item">
            <div class="main-list">
              <p>历史数据查询功能正在开发中...</p>
            </div>
          </div>
          
          <!-- 统计分析标签页 -->
          <div class="layui-tab-item">
            <div class="main-list">
              <p>数据统计分析功能正在开发中...</p>
            </div>
          </div>
        </div>
      </div>
    </main>

    <script>
      document.addEventListener('DOMContentLoaded', function() {
        // 加载保存的主题
        loadSavedTheme();
        
        // 初始化公共头部
        initCommonHeader('能耗监测中心', true);
      });
    </script>
  </body>
</html>
